﻿using MediatR;
using RBAC.MaHaiBo.API.Application.Command.LeaveCommand;
using RBAC.MaHaiBo.Entity;
using RBAC.MaHaiBo.Service;

namespace RBAC.MaHaiBo.API.Application.CommandHandlers.LeaveHandler
{
    public class LeaveShowCommandHandler:IRequestHandler<LeaveShowCommand, FenYeDTO<LeaveDTo>>
    {
        /// <summary>
        /// 请假服务层
        /// </summary>
        ILeaveService lSer;
        public LeaveShowCommandHandler(ILeaveService lSer)
        {
            this.lSer = lSer;
        }

        public async Task<FenYeDTO<LeaveDTo>> Handle(LeaveShowCommand request, CancellationToken cancellationToken)
        {
            return await lSer.GetAllLeave(request.poageiden, request.pageSzen, request.Name, request.Uid,request.lSdate,request.Addtime);
        }
    }
}
